package janino;

import java.lang.reflect.InvocationTargetException;
import org.codehaus.commons.compiler.CompileException;
import org.codehaus.janino.ScriptEvaluator;
 
public class JaninoTester04 {
 
	public static void main(String[] args) throws CompileException, InvocationTargetException {
		ScriptEvaluator se = new ScriptEvaluator();
        se.cook(
            ""
            + "static void method1() {\n"
            + "    System.out.println(\"run in method1()\");\n"
            + "}\n"
            + "\n"
            + "static void method2() {\n"
            + "    System.out.println(\"run in method2()\");\n"
            + "}\n"
            + "\n"
            + "method1();\n"
            + "method2();\n"
            + "\n"
 
        );
 
        se.evaluate(null);
	}
 
}